package com.benedu.green.moon.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.benedu.cloud.common.mybatis.plus.base.SuperEntity;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @Description:TODO
 * @author: xiaoguo
 * @date:2021/10/14 11:54
 * version:v1.0.0
 */
@Data
@TableName(value = "user", autoResultMap = true)
@TableComment("用户表")
public class UserEntity extends SuperEntity implements java.io.Serializable{
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("account")
    @Column(comment = "账号")
    private String account;
    @TableField("password")
    @Column(comment = "密码")
    private String password;
    @TableField("age")
    @Column(comment = "年龄")
    private String age;
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @TableField("create_time")
    @Column(comment = "创建时间")
    private LocalDateTime createTime;
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonSerialize(using = LocalDateSerializer.class)
    @TableField("update_time")
    @Column(comment = "修改时间")
    private LocalDate updateTime;
    @TableField("ent_code")
    @Column(comment = "账号你你你")
    private String entCode;
}
